
#pragma once

#include <cstdio>

class SglInfo
{

public:

	SglInfo();
	~SglInfo();

	INT GetError(VOID) const;
	PSGLINFO GetHandle(VOID);
	BOOL Open(LPCTSTR pszFile);
	BOOL Close(VOID);

	static SglInfo *FromHandle(PSGLINFO pHandle);

private:

	SGLINFO		m_Info;
	SGL_ERROR	m_Error;

	BOOL LoadSgl(FILE *pFile);
	BOOL LoadSgl(FILE *pFile, LPDWORD pOffTab, PSGLHASH pHashTab);
	BOOL LoadSub(FILE *pFile, PSGLSUB pSubInfo);
	VOID ClearSgl(VOID);
	VOID ClearSub(PSGLSUB pSubInfo);

};
